{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入库和数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "on_train=pd.read_csv(r'D:\\Data\\TCForNewComer\\ccf_online_stage1_train\\ccf_online_stage1_train.csv')\n",
    "off_train=pd.read_csv(r'D:\\Data\\TCForNewComer\\ccf_offline_stage1_train\\ccf_offline_stage1_train.csv')\n",
    "test=pd.read_csv(r'D:\\Data\\TCForNewComer\\ccf_offline_stage1_test_revised.csv')\n",
    "samplt=pd.read_csv(r'D:\\Data\\TCForNewComer\\sample_submission.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1754884 entries, 0 to 1754883\n",
      "Data columns (total 7 columns):\n",
      "User_id          int64\n",
      "Merchant_id      int64\n",
      "Coupon_id        object\n",
      "Discount_rate    object\n",
      "Distance         object\n",
      "Date_received    object\n",
      "Date             object\n",
      "dtypes: int64(2), object(5)\n",
      "memory usage: 93.7+ MB\n"
     ]
    }
   ],
   "source": [
    "off_train.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 14704 entries, 0 to 14703\n",
      "Data columns (total 6 columns):\n",
      "User_id          14704 non-null int64\n",
      "Merchant_id      14703 non-null float64\n",
      "Coupon_id        14703 non-null float64\n",
      "Discount_rate    14703 non-null object\n",
      "Distance         14703 non-null object\n",
      "Date_received    14703 non-null float64\n",
      "dtypes: float64(3), int64(1), object(2)\n",
      "memory usage: 689.3+ KB\n"
     ]
    }
   ],
   "source": [
    "test.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>User_id</th>\n",
       "      <th>Merchant_id</th>\n",
       "      <th>Coupon_id</th>\n",
       "      <th>Discount_rate</th>\n",
       "      <th>Distance</th>\n",
       "      <th>Date_received</th>\n",
       "      <th>Date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1439408</td>\n",
       "      <td>2632</td>\n",
       "      <td>null</td>\n",
       "      <td>null</td>\n",
       "      <td>0</td>\n",
       "      <td>null</td>\n",
       "      <td>20160217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1439408</td>\n",
       "      <td>4663</td>\n",
       "      <td>11002</td>\n",
       "      <td>150:20</td>\n",
       "      <td>1</td>\n",
       "      <td>20160528</td>\n",
       "      <td>null</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1439408</td>\n",
       "      <td>2632</td>\n",
       "      <td>8591</td>\n",
       "      <td>20:1</td>\n",
       "      <td>0</td>\n",
       "      <td>20160217</td>\n",
       "      <td>null</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1439408</td>\n",
       "      <td>2632</td>\n",
       "      <td>1078</td>\n",
       "      <td>20:1</td>\n",
       "      <td>0</td>\n",
       "      <td>20160319</td>\n",
       "      <td>null</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1439408</td>\n",
       "      <td>2632</td>\n",
       "      <td>8591</td>\n",
       "      <td>20:1</td>\n",
       "      <td>0</td>\n",
       "      <td>20160613</td>\n",
       "      <td>null</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   User_id  Merchant_id Coupon_id Discount_rate Distance Date_received  \\\n",
       "0  1439408         2632      null          null        0          null   \n",
       "1  1439408         4663     11002        150:20        1      20160528   \n",
       "2  1439408         2632      8591          20:1        0      20160217   \n",
       "3  1439408         2632      1078          20:1        0      20160319   \n",
       "4  1439408         2632      8591          20:1        0      20160613   \n",
       "\n",
       "       Date  \n",
       "0  20160217  \n",
       "1      null  \n",
       "2      null  \n",
       "3      null  \n",
       "4      null  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "off_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{nan,\n",
       " 6.0,\n",
       " 13.0,\n",
       " 15.0,\n",
       " 39.0,\n",
       " 44.0,\n",
       " 48.0,\n",
       " 75.0,\n",
       " 76.0,\n",
       " 84.0,\n",
       " 96.0,\n",
       " 113.0,\n",
       " 122.0,\n",
       " 125.0,\n",
       " 142.0,\n",
       " 166.0,\n",
       " 187.0,\n",
       " 208.0,\n",
       " 209.0,\n",
       " 212.0,\n",
       " 225.0,\n",
       " 256.0,\n",
       " 262.0,\n",
       " 269.0,\n",
       " 273.0,\n",
       " 281.0,\n",
       " 285.0,\n",
       " 286.0,\n",
       " 288.0,\n",
       " 303.0,\n",
       " 308.0,\n",
       " 314.0,\n",
       " 321.0,\n",
       " 341.0,\n",
       " 343.0,\n",
       " 365.0,\n",
       " 387.0,\n",
       " 388.0,\n",
       " 397.0,\n",
       " 398.0,\n",
       " 409.0,\n",
       " 411.0,\n",
       " 414.0,\n",
       " 416.0,\n",
       " 425.0,\n",
       " 431.0,\n",
       " 450.0,\n",
       " 451.0,\n",
       " 488.0,\n",
       " 503.0,\n",
       " 512.0,\n",
       " 517.0,\n",
       " 519.0,\n",
       " 552.0,\n",
       " 554.0,\n",
       " 560.0,\n",
       " 561.0,\n",
       " 567.0,\n",
       " 568.0,\n",
       " 576.0,\n",
       " 581.0,\n",
       " 599.0,\n",
       " 614.0,\n",
       " 619.0,\n",
       " 629.0,\n",
       " 640.0,\n",
       " 649.0,\n",
       " 656.0,\n",
       " 674.0,\n",
       " 697.0,\n",
       " 723.0,\n",
       " 748.0,\n",
       " 755.0,\n",
       " 760.0,\n",
       " 775.0,\n",
       " 796.0,\n",
       " 797.0,\n",
       " 799.0,\n",
       " 889.0,\n",
       " 892.0,\n",
       " 895.0,\n",
       " 902.0,\n",
       " 915.0,\n",
       " 924.0,\n",
       " 931.0,\n",
       " 958.0,\n",
       " 960.0,\n",
       " 986.0,\n",
       " 1011.0,\n",
       " 1015.0,\n",
       " 1022.0,\n",
       " 1034.0,\n",
       " 1041.0,\n",
       " 1051.0,\n",
       " 1061.0,\n",
       " 1065.0,\n",
       " 1075.0,\n",
       " 1077.0,\n",
       " 1125.0,\n",
       " 1155.0,\n",
       " 1174.0,\n",
       " 1177.0,\n",
       " 1181.0,\n",
       " 1184.0,\n",
       " 1213.0,\n",
       " 1228.0,\n",
       " 1233.0,\n",
       " 1243.0,\n",
       " 1244.0,\n",
       " 1249.0,\n",
       " 1253.0,\n",
       " 1282.0,\n",
       " 1300.0,\n",
       " 1307.0,\n",
       " 1316.0,\n",
       " 1322.0,\n",
       " 1328.0,\n",
       " 1331.0,\n",
       " 1333.0,\n",
       " 1336.0,\n",
       " 1346.0,\n",
       " 1351.0,\n",
       " 1352.0,\n",
       " 1356.0,\n",
       " 1360.0,\n",
       " 1363.0,\n",
       " 1375.0,\n",
       " 1390.0,\n",
       " 1403.0,\n",
       " 1406.0,\n",
       " 1418.0,\n",
       " 1427.0,\n",
       " 1430.0,\n",
       " 1438.0,\n",
       " 1446.0,\n",
       " 1469.0,\n",
       " 1481.0,\n",
       " 1486.0,\n",
       " 1492.0,\n",
       " 1541.0,\n",
       " 1544.0,\n",
       " 1563.0,\n",
       " 1565.0,\n",
       " 1566.0,\n",
       " 1569.0,\n",
       " 1576.0,\n",
       " 1598.0,\n",
       " 1601.0,\n",
       " 1604.0,\n",
       " 1615.0,\n",
       " 1623.0,\n",
       " 1631.0,\n",
       " 1636.0,\n",
       " 1648.0,\n",
       " 1693.0,\n",
       " 1699.0,\n",
       " 1710.0,\n",
       " 1715.0,\n",
       " 1735.0,\n",
       " 1759.0,\n",
       " 1765.0,\n",
       " 1782.0,\n",
       " 1784.0,\n",
       " 1805.0,\n",
       " 1810.0,\n",
       " 1820.0,\n",
       " 1825.0,\n",
       " 1829.0,\n",
       " 1837.0,\n",
       " 1845.0,\n",
       " 1853.0,\n",
       " 1859.0,\n",
       " 1860.0,\n",
       " 1864.0,\n",
       " 1870.0,\n",
       " 1873.0,\n",
       " 1897.0,\n",
       " 1900.0,\n",
       " 1905.0,\n",
       " 1912.0,\n",
       " 1923.0,\n",
       " 1940.0,\n",
       " 1950.0,\n",
       " 1964.0,\n",
       " 1967.0,\n",
       " 1979.0,\n",
       " 1982.0,\n",
       " 2010.0,\n",
       " 2022.0,\n",
       " 2050.0,\n",
       " 2070.0,\n",
       " 2074.0,\n",
       " 2087.0,\n",
       " 2106.0,\n",
       " 2119.0,\n",
       " 2123.0,\n",
       " 2125.0,\n",
       " 2130.0,\n",
       " 2159.0,\n",
       " 2166.0,\n",
       " 2177.0,\n",
       " 2186.0,\n",
       " 2196.0,\n",
       " 2198.0,\n",
       " 2199.0,\n",
       " 2202.0,\n",
       " 2206.0,\n",
       " 2207.0,\n",
       " 2211.0,\n",
       " 2224.0,\n",
       " 2233.0,\n",
       " 2237.0,\n",
       " 2247.0,\n",
       " 2251.0,\n",
       " 2264.0,\n",
       " 2266.0,\n",
       " 2271.0,\n",
       " 2277.0,\n",
       " 2305.0,\n",
       " 2306.0,\n",
       " 2322.0,\n",
       " 2331.0,\n",
       " 2333.0,\n",
       " 2339.0,\n",
       " 2345.0,\n",
       " 2346.0,\n",
       " 2356.0,\n",
       " 2361.0,\n",
       " 2377.0,\n",
       " 2378.0,\n",
       " 2382.0,\n",
       " 2394.0,\n",
       " 2404.0,\n",
       " 2423.0,\n",
       " 2433.0,\n",
       " 2434.0,\n",
       " 2436.0,\n",
       " 2447.0,\n",
       " 2459.0,\n",
       " 2460.0,\n",
       " 2473.0,\n",
       " 2488.0,\n",
       " 2490.0,\n",
       " 2508.0,\n",
       " 2519.0,\n",
       " 2541.0,\n",
       " 2542.0,\n",
       " 2556.0,\n",
       " 2559.0,\n",
       " 2567.0,\n",
       " 2574.0,\n",
       " 2595.0,\n",
       " 2616.0,\n",
       " 2622.0,\n",
       " 2626.0,\n",
       " 2632.0,\n",
       " 2635.0,\n",
       " 2648.0,\n",
       " 2661.0,\n",
       " 2664.0,\n",
       " 2672.0,\n",
       " 2679.0,\n",
       " 2691.0,\n",
       " 2692.0,\n",
       " 2701.0,\n",
       " 2703.0,\n",
       " 2705.0,\n",
       " 2707.0,\n",
       " 2709.0,\n",
       " 2714.0,\n",
       " 2727.0,\n",
       " 2731.0,\n",
       " 2738.0,\n",
       " 2756.0,\n",
       " 2765.0,\n",
       " 2781.0,\n",
       " 2803.0,\n",
       " 2807.0,\n",
       " 2813.0,\n",
       " 2815.0,\n",
       " 2846.0,\n",
       " 2848.0,\n",
       " 2852.0,\n",
       " 2902.0,\n",
       " 2922.0,\n",
       " 2963.0,\n",
       " 2973.0,\n",
       " 2979.0,\n",
       " 2981.0,\n",
       " 2987.0,\n",
       " 3046.0,\n",
       " 3064.0,\n",
       " 3068.0,\n",
       " 3075.0,\n",
       " 3094.0,\n",
       " 3101.0,\n",
       " 3103.0,\n",
       " 3109.0,\n",
       " 3112.0,\n",
       " 3114.0,\n",
       " 3115.0,\n",
       " 3116.0,\n",
       " 3117.0,\n",
       " 3123.0,\n",
       " 3146.0,\n",
       " 3155.0,\n",
       " 3160.0,\n",
       " 3170.0,\n",
       " 3171.0,\n",
       " 3173.0,\n",
       " 3209.0,\n",
       " 3218.0,\n",
       " 3222.0,\n",
       " 3240.0,\n",
       " 3250.0,\n",
       " 3251.0,\n",
       " 3291.0,\n",
       " 3305.0,\n",
       " 3318.0,\n",
       " 3330.0,\n",
       " 3335.0,\n",
       " 3342.0,\n",
       " 3353.0,\n",
       " 3364.0,\n",
       " 3376.0,\n",
       " 3389.0,\n",
       " 3394.0,\n",
       " 3406.0,\n",
       " 3423.0,\n",
       " 3424.0,\n",
       " 3426.0,\n",
       " 3444.0,\n",
       " 3447.0,\n",
       " 3450.0,\n",
       " 3462.0,\n",
       " 3470.0,\n",
       " 3477.0,\n",
       " 3486.0,\n",
       " 3504.0,\n",
       " 3507.0,\n",
       " 3518.0,\n",
       " 3527.0,\n",
       " 3550.0,\n",
       " 3554.0,\n",
       " 3575.0,\n",
       " 3597.0,\n",
       " 3598.0,\n",
       " 3621.0,\n",
       " 3632.0,\n",
       " 3636.0,\n",
       " 3641.0,\n",
       " 3646.0,\n",
       " 3664.0,\n",
       " 3673.0,\n",
       " 3681.0,\n",
       " 3693.0,\n",
       " 3698.0,\n",
       " 3732.0,\n",
       " 3739.0,\n",
       " 3749.0,\n",
       " 3770.0,\n",
       " 3775.0,\n",
       " 3777.0,\n",
       " 3802.0,\n",
       " 3803.0,\n",
       " 3823.0,\n",
       " 3847.0,\n",
       " 3861.0,\n",
       " 3862.0,\n",
       " 3867.0,\n",
       " 3871.0,\n",
       " 3872.0,\n",
       " 3876.0,\n",
       " 3885.0,\n",
       " 3892.0,\n",
       " 3899.0,\n",
       " 3903.0,\n",
       " 3916.0,\n",
       " 3925.0,\n",
       " 3927.0,\n",
       " 3939.0,\n",
       " 3952.0,\n",
       " 3954.0,\n",
       " 3960.0,\n",
       " 3970.0,\n",
       " 3971.0,\n",
       " 3992.0,\n",
       " 4002.0,\n",
       " 4011.0,\n",
       " 4017.0,\n",
       " 4024.0,\n",
       " 4030.0,\n",
       " 4043.0,\n",
       " 4044.0,\n",
       " 4045.0,\n",
       " 4048.0,\n",
       " 4053.0,\n",
       " 4059.0,\n",
       " 4083.0,\n",
       " 4084.0,\n",
       " 4094.0,\n",
       " 4100.0,\n",
       " 4105.0,\n",
       " 4113.0,\n",
       " 4116.0,\n",
       " 4123.0,\n",
       " 4137.0,\n",
       " 4149.0,\n",
       " 4166.0,\n",
       " 4182.0,\n",
       " 4220.0,\n",
       " 4232.0,\n",
       " 4260.0,\n",
       " 4278.0,\n",
       " 4286.0,\n",
       " 4291.0,\n",
       " 4296.0,\n",
       " 4297.0,\n",
       " 4317.0,\n",
       " 4320.0,\n",
       " 4322.0,\n",
       " 4331.0,\n",
       " 4333.0,\n",
       " 4338.0,\n",
       " 4354.0,\n",
       " 4360.0,\n",
       " 4403.0,\n",
       " 4405.0,\n",
       " 4417.0,\n",
       " 4427.0,\n",
       " 4438.0,\n",
       " 4445.0,\n",
       " 4471.0,\n",
       " 4515.0,\n",
       " 4519.0,\n",
       " 4526.0,\n",
       " 4530.0,\n",
       " 4531.0,\n",
       " 4536.0,\n",
       " 4543.0,\n",
       " 4546.0,\n",
       " 4568.0,\n",
       " 4569.0,\n",
       " 4577.0,\n",
       " 4581.0,\n",
       " 4582.0,\n",
       " 4583.0,\n",
       " 4595.0,\n",
       " 4622.0,\n",
       " 4627.0,\n",
       " 4629.0,\n",
       " 4630.0,\n",
       " 4645.0,\n",
       " 4654.0,\n",
       " 4661.0,\n",
       " 4676.0,\n",
       " 4677.0,\n",
       " 4696.0,\n",
       " 4714.0,\n",
       " 4718.0,\n",
       " 4728.0,\n",
       " 4747.0,\n",
       " 4748.0,\n",
       " 4759.0,\n",
       " 4792.0,\n",
       " 4807.0,\n",
       " 4808.0,\n",
       " 4826.0,\n",
       " 4832.0,\n",
       " 4856.0,\n",
       " 4860.0,\n",
       " 4866.0,\n",
       " 4874.0,\n",
       " 4883.0,\n",
       " 4885.0,\n",
       " 4888.0,\n",
       " 4901.0,\n",
       " 4924.0,\n",
       " 4926.0,\n",
       " 4937.0,\n",
       " 4951.0,\n",
       " 4953.0,\n",
       " 4956.0,\n",
       " 4958.0,\n",
       " 4963.0,\n",
       " 4975.0,\n",
       " 5004.0,\n",
       " 5010.0,\n",
       " 5013.0,\n",
       " 5018.0,\n",
       " 5029.0,\n",
       " 5030.0,\n",
       " 5032.0,\n",
       " 5044.0,\n",
       " 5053.0,\n",
       " 5075.0,\n",
       " 5077.0,\n",
       " 5084.0,\n",
       " 5086.0,\n",
       " 5097.0,\n",
       " 5113.0,\n",
       " 5121.0,\n",
       " 5132.0,\n",
       " 5136.0,\n",
       " 5138.0,\n",
       " 5140.0,\n",
       " 5152.0,\n",
       " 5159.0,\n",
       " 5163.0,\n",
       " 5172.0,\n",
       " 5179.0,\n",
       " 5181.0,\n",
       " 5183.0,\n",
       " 5202.0,\n",
       " 5231.0,\n",
       " 5236.0,\n",
       " 5253.0,\n",
       " 5256.0,\n",
       " 5261.0,\n",
       " 5270.0,\n",
       " 5274.0,\n",
       " 5277.0,\n",
       " 5283.0,\n",
       " 5290.0,\n",
       " 5308.0,\n",
       " 5337.0,\n",
       " 5349.0,\n",
       " 5353.0,\n",
       " 5371.0,\n",
       " 5382.0,\n",
       " 5383.0,\n",
       " 5384.0,\n",
       " 5385.0,\n",
       " 5401.0,\n",
       " 5408.0,\n",
       " 5413.0,\n",
       " 5418.0,\n",
       " 5472.0,\n",
       " 5483.0,\n",
       " 5488.0,\n",
       " 5496.0,\n",
       " 5505.0,\n",
       " 5509.0,\n",
       " 5512.0,\n",
       " 5535.0,\n",
       " 5543.0,\n",
       " 5557.0,\n",
       " 5577.0,\n",
       " 5609.0,\n",
       " 5643.0,\n",
       " 5650.0,\n",
       " 5677.0,\n",
       " 5696.0,\n",
       " 5697.0,\n",
       " 5717.0,\n",
       " 5722.0,\n",
       " 5728.0,\n",
       " 5731.0,\n",
       " 5734.0,\n",
       " 5737.0,\n",
       " 5752.0,\n",
       " 5753.0,\n",
       " 5755.0,\n",
       " 5761.0,\n",
       " 5762.0,\n",
       " 5773.0,\n",
       " 5774.0,\n",
       " 5775.0,\n",
       " 5777.0,\n",
       " 5800.0,\n",
       " 5831.0,\n",
       " 5862.0,\n",
       " 5867.0,\n",
       " 5870.0,\n",
       " 5871.0,\n",
       " 5897.0,\n",
       " 5903.0,\n",
       " 5930.0,\n",
       " 5939.0,\n",
       " 5950.0,\n",
       " 5965.0,\n",
       " 5966.0,\n",
       " 5969.0,\n",
       " 5977.0,\n",
       " 5988.0,\n",
       " 5995.0,\n",
       " 6000.0,\n",
       " 6025.0,\n",
       " 6034.0,\n",
       " 6043.0,\n",
       " 6046.0,\n",
       " 6056.0,\n",
       " 6060.0,\n",
       " 6106.0,\n",
       " 6121.0,\n",
       " 6126.0,\n",
       " 6135.0,\n",
       " 6182.0,\n",
       " 6184.0,\n",
       " 6186.0,\n",
       " 6189.0,\n",
       " 6220.0,\n",
       " 6227.0,\n",
       " 6230.0,\n",
       " 6235.0,\n",
       " 6272.0,\n",
       " 6281.0,\n",
       " 6288.0,\n",
       " 6296.0,\n",
       " 6312.0,\n",
       " 6314.0,\n",
       " 6317.0,\n",
       " 6340.0,\n",
       " 6358.0,\n",
       " 6359.0,\n",
       " 6360.0,\n",
       " 6361.0,\n",
       " 6362.0,\n",
       " 6372.0,\n",
       " 6376.0,\n",
       " 6377.0,\n",
       " 6386.0,\n",
       " 6395.0,\n",
       " 6403.0,\n",
       " 6405.0,\n",
       " 6413.0,\n",
       " 6414.0,\n",
       " 6426.0,\n",
       " 6442.0,\n",
       " 6453.0,\n",
       " 6462.0,\n",
       " 6473.0,\n",
       " 6481.0,\n",
       " 6485.0,\n",
       " 6503.0,\n",
       " 6504.0,\n",
       " 6508.0,\n",
       " 6515.0,\n",
       " 6522.0,\n",
       " 6530.0,\n",
       " 6553.0,\n",
       " 6568.0,\n",
       " 6571.0,\n",
       " 6575.0,\n",
       " 6582.0,\n",
       " 6604.0,\n",
       " 6610.0,\n",
       " 6614.0,\n",
       " 6619.0,\n",
       " 6628.0,\n",
       " 6639.0,\n",
       " 6643.0,\n",
       " 6650.0,\n",
       " 6664.0,\n",
       " 6711.0,\n",
       " 6741.0,\n",
       " 6746.0,\n",
       " 6761.0,\n",
       " 6763.0,\n",
       " 6764.0,\n",
       " 6767.0,\n",
       " 6769.0,\n",
       " 6796.0,\n",
       " 6817.0,\n",
       " 6825.0,\n",
       " 6846.0,\n",
       " 6847.0,\n",
       " 6853.0,\n",
       " 6858.0,\n",
       " 6863.0,\n",
       " 6868.0,\n",
       " 6879.0,\n",
       " 6882.0,\n",
       " 6894.0,\n",
       " 6901.0,\n",
       " 6905.0,\n",
       " 6936.0,\n",
       " 6955.0,\n",
       " 6963.0,\n",
       " 6978.0,\n",
       " 6982.0,\n",
       " 6987.0,\n",
       " 6996.0,\n",
       " 7004.0,\n",
       " 7006.0,\n",
       " 7008.0,\n",
       " 7011.0,\n",
       " 7018.0,\n",
       " 7024.0,\n",
       " 7029.0,\n",
       " 7037.0,\n",
       " 7043.0,\n",
       " 7046.0,\n",
       " 7047.0,\n",
       " 7064.0,\n",
       " 7074.0,\n",
       " 7076.0,\n",
       " 7078.0,\n",
       " 7113.0,\n",
       " 7118.0,\n",
       " 7136.0,\n",
       " 7142.0,\n",
       " 7161.0,\n",
       " 7174.0,\n",
       " 7176.0,\n",
       " 7195.0,\n",
       " 7206.0,\n",
       " 7208.0,\n",
       " 7213.0,\n",
       " 7220.0,\n",
       " 7221.0,\n",
       " 7229.0,\n",
       " 7245.0,\n",
       " 7248.0,\n",
       " 7259.0,\n",
       " 7292.0,\n",
       " 7294.0,\n",
       " 7307.0,\n",
       " 7315.0,\n",
       " 7316.0,\n",
       " 7318.0,\n",
       " 7321.0,\n",
       " 7324.0,\n",
       " 7328.0,\n",
       " 7344.0,\n",
       " 7346.0,\n",
       " 7347.0,\n",
       " 7354.0,\n",
       " 7357.0,\n",
       " 7364.0,\n",
       " 7373.0,\n",
       " 7374.0,\n",
       " 7417.0,\n",
       " 7418.0,\n",
       " 7422.0,\n",
       " 7465.0,\n",
       " 7470.0,\n",
       " 7476.0,\n",
       " 7483.0,\n",
       " 7487.0,\n",
       " 7494.0,\n",
       " 7503.0,\n",
       " 7507.0,\n",
       " 7510.0,\n",
       " 7522.0,\n",
       " 7524.0,\n",
       " 7550.0,\n",
       " 7553.0,\n",
       " 7555.0,\n",
       " 7576.0,\n",
       " 7602.0,\n",
       " 7605.0,\n",
       " 7609.0,\n",
       " 7613.0,\n",
       " 7672.0,\n",
       " 7673.0,\n",
       " 7678.0,\n",
       " 7679.0,\n",
       " 7717.0,\n",
       " 7721.0,\n",
       " 7736.0,\n",
       " 7748.0,\n",
       " 7757.0,\n",
       " 7759.0,\n",
       " 7767.0,\n",
       " 7772.0,\n",
       " 7782.0,\n",
       " 7788.0,\n",
       " 7789.0,\n",
       " 7803.0,\n",
       " 7810.0,\n",
       " 7819.0,\n",
       " 7822.0,\n",
       " 7838.0,\n",
       " 7841.0,\n",
       " 7843.0,\n",
       " 7855.0,\n",
       " 7859.0,\n",
       " 7884.0,\n",
       " 7903.0,\n",
       " 7910.0,\n",
       " 7920.0,\n",
       " 7927.0,\n",
       " 7942.0,\n",
       " 7963.0,\n",
       " 7967.0,\n",
       " 7974.0,\n",
       " 7989.0,\n",
       " 7996.0,\n",
       " 7998.0,\n",
       " 8000.0,\n",
       " 8022.0,\n",
       " 8037.0,\n",
       " 8066.0,\n",
       " 8076.0,\n",
       " 8086.0,\n",
       " 8095.0,\n",
       " 8097.0,\n",
       " 8098.0,\n",
       " 8131.0,\n",
       " 8149.0,\n",
       " 8150.0,\n",
       " 8162.0,\n",
       " 8182.0,\n",
       " 8186.0,\n",
       " 8201.0,\n",
       " 8202.0,\n",
       " 8210.0,\n",
       " 8212.0,\n",
       " 8227.0,\n",
       " 8235.0,\n",
       " 8249.0,\n",
       " 8253.0,\n",
       " 8254.0,\n",
       " 8265.0,\n",
       " 8267.0,\n",
       " 8269.0,\n",
       " 8278.0,\n",
       " 8281.0,\n",
       " 8282.0,\n",
       " 8286.0,\n",
       " 8287.0,\n",
       " 8288.0,\n",
       " 8305.0,\n",
       " 8318.0,\n",
       " 8326.0,\n",
       " 8336.0,\n",
       " 8355.0,\n",
       " 8357.0,\n",
       " 8366.0,\n",
       " 8375.0,\n",
       " 8384.0,\n",
       " 8386.0,\n",
       " 8415.0,\n",
       " 8422.0,\n",
       " 8438.0,\n",
       " 8449.0,\n",
       " 8455.0,\n",
       " 8466.0,\n",
       " 8476.0,\n",
       " 8480.0,\n",
       " 8497.0,\n",
       " 8502.0,\n",
       " 8506.0,\n",
       " 8510.0,\n",
       " 8517.0,\n",
       " 8545.0,\n",
       " 8563.0,\n",
       " 8580.0,\n",
       " 8599.0,\n",
       " 8607.0,\n",
       " 8608.0,\n",
       " 8614.0,\n",
       " 8634.0,\n",
       " 8640.0,\n",
       " 8653.0,\n",
       " 8656.0,\n",
       " 8662.0,\n",
       " 8678.0,\n",
       " 8705.0,\n",
       " 8706.0,\n",
       " 8716.0,\n",
       " 8736.0,\n",
       " 8753.0,\n",
       " 8761.0,\n",
       " 8769.0,\n",
       " 8776.0,\n",
       " 8791.0,\n",
       " 8837.0,\n",
       " 8843.0,\n",
       " 8844.0,\n",
       " 8848.0,\n",
       " 8852.0}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(test['Merchant_id'].values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
